Skip to content

refactor: unify #[pg_extern] attribute parsing via syn#2317

Merged
eeeebbbbrrrr merged 2 commits into
pgcentralfoundation:developfrom
isdaniel:refactor/unify-pg_extern-attr-parsing
Jun 8, 2026
Merged

refactor: unify #[pg_extern] attribute parsing via syn#2317
eeeebbbbrrrr merged 2 commits into
pgcentralfoundation:developfrom
isdaniel:refactor/unify-pg_extern-attr-parsing

Conversation

@isdaniel

@isdaniel isdaniel commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Motivation

  • Collapses three diverging code paths that handled #[pg_extern] / #[pg_test] attributes into a single syn-based parser.
  • Fixes latent bug in #[pg_test] argument parsing exposed by raw and malformed string literals.

Bugs fixed

Raw-string corruption in #[pg_test(expected = ...)] — the old walker did literal.to_string()[1..len-1], which strips one byte each side. For r#"foo "bar""# it produced #"foo "bar""# (delimiters leaked into the value), making the runtime error-message comparison silently mismatch.

for #2316

…lformed string literals

Unify extern attribute parsing and streamline extern args handling
@isdaniel
isdaniel force-pushed the refactor/unify-pg_extern-attr-parsing branch from 1064389 to fc84062 Compare June 8, 2026 07:02

@eeeebbbbrrrr eeeebbbbrrrr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good cleanup, thanks.

@eeeebbbbrrrr
eeeebbbbrrrr merged commit 20a1fc6 into pgcentralfoundation:develop Jun 8, 2026
22 of 28 checks passed
eeeebbbbrrrr added a commit that referenced this pull request Jun 23, 2026
Welcome to pgrx v0.19.0. Among other things, this brings support for
Postgres v19beta1.

As usual, install cargo-pgrx with `cargo install cargo-pgrx --version
0.19.0 --locked`, and if you want Postgres 19beta1 support you'll also
need to run `cargo pgrx init`. And make sure to update your crate
dependencies with `cargo pgrx upgrade`.


## What's Changed

* add pg19beta1 support by @eeeebbbbrrrr in
#2303

The headline item. As more betas are released we'll release new pgrx
point releases supporting them.

* upgrade dependencies and rust edition to 2024 by @eeeebbbbrrrr in
#2312

Notably, pgrx wants to use the Rust 2024 edition now.

### cargo-pgrx

* fix(cargo-pgrx): preserve cargo rustflags for cdylib builds by
@eeeebbbbrrrr in #2304

Prior to this fix, RUSTFLAGS changes in `.cargo/config.toml` would have
been ignored.

* Retry Postgres downloads during init by @eeeebbbbrrrr in
#2314
* fix: `cargo pgrx schema named_sql_entity` should export
schema-qualified by @eeeebbbbrrrr in
#2310
* Replace cargo-edit with crates-index and toml_edit by @cbandy in
#2305
* feat(cargo-pgrx): accept Cargo VersionReq syntax for upgrade --to by
@isdaniel in #2321


### New Features

* Add #[pg_guc_hook] macro for simple GUC hooks by @cbandy in
#2323



### Postgres Bindings and Wrappers

* feat: expose PGLZ compression bindings + add pglz_inspect example by
@isdaniel in #2326
* fix: bridge buffer page helpers via cshim on PG16+ by @mrdrivingduck
in #2331
* Fix binding of `struct Port` on pg17 by @cbandy in
#2302
* feat: add Bytea<'fcx> argument type with zero-copy return by @isdaniel
in #2301
* Add wrappers for postgres geometric types. by @hamiltop in
#1332


### Bugfixes and Cleanup

* Guard pgrx docs.rs release builds by @eeeebbbbrrrr in
#2315
* Fix docs.rs build by localizing docsrs cfg by @eeeebbbbrrrr in
#2299
* remove redundant casts and improve safety in varlena functions by
@isdaniel in #2298
* Update trybuild to 1.0.116 by @cbandy in
#2306
* Quiet two errors from rust-analyzer by @cbandy in
#2307
* fix dependabot security warnings by @eeeebbbbrrrr in
#2313
* refactor: unify #[pg_extern] attribute parsing via syn by @isdaniel in
#2317
* chore: add examples PostgresType in/out variants and memory-context
patterns by @isdaniel in
#2318
* docs(spi): clarify SpiClient::select vs update for read-only vs
writable SPI by @uded in
#2328
* fix pg19 drift by @eeeebbbbrrrr in
#2330

## New Contributors

* @hamiltop made their first contribution in
#1332
* @uded made their first contribution in
#2328

**Full Changelog**:
v0.18.1...v0.19.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants